<?php

namespace Common\Model;

use Think\Model;

class BbsTagModel extends Model
{
    /**
     * 主题Tag列表
     * @param      $map
     * @param bool $fill
     * @return array|mixed
     */
    public function get_list($map, $fill = false)
    {
        $list = $this->where($map)->select();

        if ($fill === true) {
            $list = array_map(array($this, 'fill'), $list);
        }

        return $list;
    }

    /**
     * 字段填充
     */
    public function fill($item)
    {
        $item['tagurl'] = RU('tag/view', array('t' => $item['tagid'], 'type' => 3));
        return $item;
    }
}